package com.demo.principle.interfaceIsolation;

public class InterfaceIsolation {

    public static void main(String[] args) {

    }
}


interface Interface1 {
    void operation1();

    void operation2();

    void operation3();

    void operation4();

    void operation5();
}

class ClassB implements Interface1 {

    @Override
    public void operation1() {
        System.out.println("operation1");
    }

    @Override
    public void operation2() {
        System.out.println("operation2");
    }

    @Override
    public void operation3() {
        System.out.println("operation3");
    }

    @Override
    public void operation4() {
        System.out.println("operation4");
    }

    @Override
    public void operation5() {
        System.out.println("operation5");
    }
}

class ClassA {
    public void depend1(Interface1 i) {
        i.operation1();
    }

    public void depend2(Interface1 i) {
        i.operation2();
    }

    public void depend3(Interface1 i) {
        i.operation2();
    }
}

class ClassD implements Interface1 {

    @Override
    public void operation1() {
        System.out.println("operation1");
    }

    @Override
    public void operation2() {
        System.out.println("operation2");
    }

    @Override
    public void operation3() {
        System.out.println("operation3");
    }

    @Override
    public void operation4() {
        System.out.println("operation4");
    }

    @Override
    public void operation5() {
        System.out.println("operation5");
    }
}

class ClassC {
    public void depend1(Interface1 i) {
        i.operation1();
    }

    public void depend4(Interface1 i) {
        i.operation4();
    }

    public void depend5(Interface1 i) {
        i.operation5();
    }
}